
package pos.entity;

import java.sql.Date;
import java.util.ArrayList;

/**
 * This is an entity object for the Order table
 * @author Anup
 */
public class Order {
   private long orderId;
   private long storeId;
   private long empId;
   private long customerId;
   private String source = "POS";
   private double basePrice = 0.0;
   private double tax = 0.0;
   private double totalPrice = 0.0;
   private double discount = 0.0;
   
   private Date orderDate = null;
   private Date createDate = null;
   private Date modDate = null;
   
   private ArrayList<PurchasedItem> purchaseditems = new ArrayList<PurchasedItem>();
   private ArrayList<Item> items = new ArrayList<Item>(); 

   /**
    * Sets the collection of purchased items
    * @param puchaseditems 
    */
   public void setPurchasedItems(ArrayList<PurchasedItem> puchaseditems) {
        this.purchaseditems = puchaseditems;
    }
    /**
    * Returns the Purchased object list
    * @return 
    */
    public ArrayList<PurchasedItem> getPurchasedItems() {
        return purchaseditems;
    }
    /**
     * Returns the Order Id
     * @return 
     */
    public long getOrderId() {
        return orderId;
    }

    /**
     * Sets the orderid
     * @param orderId 
     */
    public void setOrderId(long orderId) {
        this.orderId = orderId;
    }
    /**
     * Sets the order date time
     * @param orderDate 
     */
    public void setOrderDateTime(Date orderDate){
        this.orderDate = orderDate;
    }
    public Date getOrderDateTime(){
        return orderDate;
    }
    public void setStoreId(long storeId){
        this.storeId = storeId;
    }
    public long getStoreId(){
        return storeId;
    }
    /**
     * Sets the source of the Transaction, whether POS or Desktop
     * @param source 
     */
    public void setOrderTransactionSource(String source){
        this.source = source;
    }
    public String getOrderTransactionSource(){
        return source;
    }
    /**
     * Sets the total base price of this order, it is the sum of the base prices of the purchased items.
     * @param basePrice 
     */
    public void setOrderTotalBasePrice(double basePrice){
        this.basePrice = basePrice;
    }
    public double getOrderTotalBasePrice(){
        return basePrice;
    }
    public void setOrderTotalAdjustedAmount(double sumDiscount){
        this.discount = sumDiscount;
    }
    public double getOrderTotalAdjustedAmount(){
        return discount;
    }
    public void setOrderTotalTaxes(double sumTaxes){
        this.tax = sumTaxes;
    }
    /**
     * Returns the total taxes of the order
     * @return 
     */
    public double getOrderTotalTaxes(){
        return tax;
    }
    /**
     * Sets the order total price
     * @param totalPrice 
     */
    public void setOrderTotalPrice(double totalPrice){
        this.totalPrice = totalPrice;
    }
    public double getOrderTotalPrice(){
        return totalPrice;
    }
    public void setOrderTakenByEmployeeId(long empId){
        this.empId = empId;
    }
    public long getOrderTakenByEmployeeId(){
        return empId;
    }
    public void setCustomerId(long customerId){
        this.customerId = customerId;
    }
    public long getCustomerId(){
        return customerId;
    }
    public void setDateTimeCreated(Date createTime){
        this.createDate = createTime;
    }
    public Date getDateTimeCreated(){
        return createDate;
    }
    public void setOrderDateModified(Date modTime){
        this.modDate = modTime;
    }
    public Date getOrderDateModified(){
        return modDate;
    }

    /**
     * @return the items
     */
    public ArrayList<Item> getItems() {
        return items;
    }
}
